package ubadb.bench;

import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;

import ubadb.bench.tests.Test;
import ubadb.bench.util.TraceUtil;
import ubadb.external.bufferManagement.etc.PageReferenceTrace;

public class MultipleBuffersCompare {

	private static final String TRACE_BASE = "ubadb/bench/traces/scenery3";
	private static String[] TRACE_RESOURCES = new String[] {
			"mixedB_tot10_conc2.trace", "mixedC_tot50_conc2.trace",
			"mixedD_tot50_conc5.trace", "mixedE_tot100_conc5.trace" };

	public static void main(String[] args) {
		try {
			go();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void go() throws FileNotFoundException {
		List<Test> tests = new ArrayList<Test>();
		for (String traceResource : TRACE_RESOURCES) {
			PageReferenceTrace trace = TraceUtil.readTrace(TRACE_BASE + "/"
					+ traceResource);
			tests.add(new Test(traceResource, trace));
		}
		SingleBufferCompare.test(tests.toArray(new Test[tests.size()]),
				MultipleBufferPoolTestCase.CASES, "output3.csv");
	}
}
